package com.joker.demo.core.domain.dto;

/**
 * Netty通信消息实体类
 * @author : feixiang.li
 * @since : 2025-07-24 16:57
 */
public class MessageDTO {

    /**
     * 消息类型
     */
    private String type;

    /**
     * 消息ID
     */
    private String messageId;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 发送时间
     */
    private Long timestamp;

    /**
     * 消息来源
     */
    private String source;

    /**
     * 消息目标
     */
    private String target;


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public MessageDTO(String type, String messageId, String content, String source, String target) {
        this.type = type;
        this.messageId = messageId;
        this.content = content;
        this.timestamp = System.currentTimeMillis();
        this.source = source;
        this.target = target;
    }


    public MessageDTO() {
        this.timestamp = System.currentTimeMillis();
    }

    public MessageDTO(String type, String content) {
        this();
        this.type = type;
        this.content = content;
    }

    public MessageDTO(String type, String messageId, String content) {
        this(type, content);
        this.messageId = messageId;
    }
} 